// 1. 要有组件
import { createWebHashHistory, createRouter } from 'vue-router';
import ResetPassword from '@/view/ResetPassword.vue' // 根据您的目录结构调整路径


// 2. 定义一些路由（路径与组件之间的映射）
const routes = [
    // 后台管理员
    {name: 'login',path: '/login', component: ()=>import('@/view/Login.vue')},
    {name: 'index', path: '/', component: ()=>import('@/view/Index.vue'), children: [
            {name: 'cinema',path: '/cinema', component: ()=>import('@/view/Cinema.vue')},
            {name: 'charts',path: '/charts', component: ()=>import('@/view/Charts.vue')},
            {name: 'movie',path: '/movie', component: ()=>import('@/view/Movie.vue')},
            {name: 'movieCategory',path: '/movieCategory', component: ()=>import('@/view/MovieCategory.vue')},
            {name: 'hall',path: '/hall', component: ()=>import('@/view/Hall.vue')},
            {name: 'session',path: '/session', component: ()=>import('@/view/Session.vue')},
            {name: 'bill',path: '/bill', component: ()=>import('@/view/Bill.vue')},
            {name: 'user',path: '/user', component: ()=>import('@/view/User.vue')},
            {name: 'role',path: '/role', component: ()=>import('@/view/role.vue')},
            // src/router/index.js
            // {name: 'modifyInfo', path: '/modifyInfo', component: () => import('@/view/ModifyInfo.vue')},
            {path: '/updateInfo', name: 'UpdateInfo', component: () => import('@/view/UpdateInfo.vue')},
            {path: '/reset-password',name: 'ResetPassword', component: () => import('@/view/ResetPassword.vue')},
        ]},
];
// 3. 创建路由
const router = createRouter({
    history: createWebHashHistory(),    // 历史记录
    routes: routes,
});
// 路由是否已经加载
router.load = false;
// 4. 暴露
export default router